// ComponentB.vue
<template>
  <div>
    <p>{{ message }}</p>
  </div>
</template>

<script>
import { useEventBus } from './EventBus.js';

export default {
  data() {
    return {
      message: ''
    };
  },
  created() {
    const eventBus = useEventBus();
    eventBus.on('message', data => {
      this.message = data;
    });
  }
};
</script>